<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping assembly="SimCMS.Model" namespace="SimCMS.Model" xmlns="urn:nhibernate-mapping-2.2">
  <class name="Simadmin" table="Sim_admin" lazy="true" >
    <id name="Id" unsaved-value="null">
      <generator class="identity" />
    </id>
    <property name="UserName">
      <column name="UserName" sql-type="nvarchar" not-null="false" />
    </property>
    <property name="Password">
      <column name="Password" sql-type="nvarchar" not-null="false" />
    </property>
    <property name="Encrypt">
      <column name="Encrypt" sql-type="nvarchar" not-null="false" />
    </property>
    <property name="LastLoginIp">
      <column name="LastLoginIp" sql-type="nvarchar" not-null="false" />
    </property>
    <property name="LastLoginTime">
      <column name="LastLoginTime" sql-type="datetime" not-null="false" />
    </property>
    <property name="Email">
      <column name="Email" sql-type="nvarchar" not-null="false" />
    </property>
    <property name="RealName">
      <column name="RealName" sql-type="nvarchar" not-null="false" />
    </property>
    <property name="Card">
      <column name="Card" sql-type="nvarchar" not-null="false" />
    </property>
    <many-to-one name="Simadminrole"  column="RoleId"  not-null="true"/>

    <bag name="Simadminpanel" inverse="true" cascade="all">
      <key column="UserId" not-null="true" />
      <one-to-many class="Simadminpanel" />
    </bag>
  </class>

  <sql-query name="Login"  >
    <return alias="Simadmin" class="Simadmin"/>
    <![CDATA[ select * from Sim_admin u where u.UserName = :UserName and u.Password=:Password  ]]>
  </sql-query>
</hibernate-mapping>